package com.nali.dal.statement.query;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.nali.dal.statement.util.DalCollectionUtils;

public class Traner {
	private List<ColumnUnit> valueColumns;
	
	public Traner(List<ColumnUnit> valueColumns) {
		this.valueColumns = valueColumns;
	}

	public Map<String, Object> tran(Map<String, Object> queryRlt) {
		if(DalCollectionUtils.isEmpty(valueColumns)) {
			return queryRlt;
		} else {
			HashMap<String, Object> rlt = DalCollectionUtils.newHashMap(valueColumns.size());
			for (ColumnUnit columnUnit : valueColumns) {
				rlt.put(columnUnit.getName(), columnUnit.getColumnValue(queryRlt));
			}
			return rlt;
		}
	}
}
